<template>
	<view class="content">
			<view class="top_txt">
				商品可按比例拒提大王币，尊贵商品按原价30%拒提为大王币，稀 有及以上按原价90%拒提为大王币
			</view>
		<view class="wain_top" v-for="(item, index) in recordList" :key="index" v-if="recordList">
			<view class="left">
				<view>{{item.create_time}}</view>
				<view>{{item.desc}}</view>
			</view>
			<view class="right">
				{{item.type==1?'-':'+'}}{{item.num}}
			</view>
		</view>
		<view class="emptya flex-column flex-c-c" v-if="recordList == ''">
			<!-- <image src="https://pd.pdaxiang.com/upload/static/index/null.png"></image> -->
			<text class="size-32 color-h">暂无记录</text>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			page:1,
			recordList:[]
		};
	},
	onShow() {
		this.getlist();
	},
	onPullDownRefresh() {
		this.page=1;
		setTimeout(() => {
			uni.stopPullDownRefresh();
		}, 1000);
		 clearTimeout();
		this.recordList = []
		this.getlist();
	},
	onReachBottom() {
		this.page++;
		this.getlist(2);
	},
	methods: {
		getlist(type){
			let data = {
				page:this.page
			}
			this.$Request.get(this.$api.user.fragmentList,data).then(res => {
				if(type==2){
					this.recordList = this.recordList.concat(res.data.list) 
				}else{
					this.recordList = res.data.list
				}
			});
		}
	},
};
</script>

<style lang="scss" scoped>
	.content{
		background: #fff;
		min-height: 100vh;
		padding-top: 20rpx;
	}
	.wain_top{
		width: 710rpx;
		background: #FFFFFF;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
		box-sizing: border-box;
		margin-bottom: 10rpx;
		border-bottom: 1px solid #BCBEBE;
		.right{
			display: flex;
			flex-direction: column;
			.top{
				font-size: 22rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FD8E1B;
			}
			
		}
		.left{
			display: flex;
			flex-direction: column;
			width: 100%;
			.bom{
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #282828;
			}
			view{
				padding: 0rpx 0 10rpx 0rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #333333;
			}
			view:nth-of-type(2){
				display:flex;
				justify-content: space-between;
				align-items: center;
				text:nth-of-type(1){
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}
				text:nth-of-type(2){
					font-size: 30rpx;
					color: #333333;
					font-weight: 400;
					padding-left: 40rpx;
				}
			}
		}
	}
</style>
